#include "gtest/gtest.h"


#include "stream/impl/rocksdb/Meta.h"
#include "stream/impl/rocksdb/meta/Size.h"
#include "stream/impl/rocksdb/Rocksdb.h"

using Meta=stream::impl::rocksdb::Meta;
using Rocksdb = stream::impl::rocksdb::Rocksdb;

TEST(MetaTest, test){
	Meta meta("test-meta.db");
	ASSERT_TRUE(meta.open());

	ASSERT_EQ(0ull, meta.size().get());

	meta.size().load();
	ASSERT_EQ(0ull, meta.size().get());

	meta.size().set(11ull);
	meta.size().store();
	ASSERT_EQ(11ull, meta.size().get());

	//clear 
	meta.size().set(0ull);
	meta.size().store();
	ASSERT_EQ(0ull, meta.size().get());

	meta.close();
}
